package com.goldgov.code.meta;

import com.goldgov.code.utils.StringUtils;

public class FieldInfo {

	private String fieldID;
	private String moduleID;
	private String name; //
	private String explain; //语义
	private FieldType type; //
	private String field;//字段名
	
	private Constraint constraint;//属性约束

	private int length;
	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public int getScale() {
		return scale;
	}

	public void setScale(int scale) {
		this.scale = scale;
	}

	private int scale;
	
	public String getName() {
		if(name == null) {
			name = StringUtils.clearSeparator(field, '_');
		}
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getExplain() {
		if(explain == null) {
			return name;
		}
		return explain;
	}

	public void setExplain(String explain) {
		this.explain = explain;
	}

	public FieldType getType() {
		return type;
	}

	public void setType(FieldType type) {
		this.type = type;
	}

	public String getModuleID() {
		return moduleID;
	}

	public void setModuleID(String moduleID) {
		this.moduleID = moduleID;
	}

	public String getField() {
		return field;
	}

	public void setField(String field) {
		this.field = field;
	}

	public Constraint getConstraint() {
		return constraint;
	}

	public void setConstraint(Constraint constraint) {
		this.constraint = constraint;
	}

	public String getFieldID() {
		return fieldID;
	}

	public void setFieldID(String fieldID) {
		this.fieldID = fieldID;
	}
	
}
